import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import {ElementPlusResolver} from 'unplugin-vue-components/resolvers'
import prismjs from 'vite-plugin-prismjs';
import visualizer from "rollup-plugin-visualizer";

// https://vitejs.dev/config/
export default defineConfig({
    base: '/',
    chunkSizeWarningLimit: 500,
    optimizeDeps: {
        include: ['@kangc/v-md-editor/lib/theme/vuepress.js'],
    },
    build: {
        manifest: false,
        rollupOptions: {
            output: {
                chunkFileNames: "static/js/[name].js",
                entryFileNames: "static/js/[name].js",
                assetFileNames: "static/[ext]/[name].[ext]",
            },
        }
    },
    plugins: [
        vue(),
        AutoImport({
            resolvers: [ElementPlusResolver()],
        }),
        Components({
            resolvers: [ElementPlusResolver()],
        }),
        prismjs({
            languages: 'all',
        }),
        visualizer({
            open: true,
            gzipSize: true,
            brotliSize: true,
        }),
    ]
})
